package com.lovo.project.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lovo.project.bean.WarehouseBean;
import com.lovo.project.mapper.WarehouseMapper;
import com.lovo.project.service.WarehouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper, WarehouseBean> implements WarehouseService {

    @Autowired
    WarehouseMapper warehouseMapper;

    @Override
    public Page<WarehouseBean> queryGoodsList(Page<WarehouseBean> page, QueryWrapper queryWrapper) {
        Page<WarehouseBean> page1 = warehouseMapper.selectPage(page, queryWrapper);
        return page1;
    }

    @Override
    public WarehouseBean queryWarehouse(Integer id) {
        WarehouseBean warehouseBean = warehouseMapper.selectById(id);
        return warehouseBean;
    }

    @Override
    public void updateGoodsPrice(WarehouseBean warehouseBean) {
        warehouseMapper.updateById(warehouseBean);
    }
}
